<?php


namespace App\Http\Controllers\android\model;


use Illuminate\Support\Facades\DB;

class ParentSnModel
{
    public static function queryLeftAdminSn($where,$field){
        return DB::table('t_parent_sn as p')
            ->leftJoin('t_admin_sn as a','p.admin_sn_id','=','a.id')
            ->where($where)
            ->first($field);
    }

    public static function delete($where){
        return DB::table('t_parent_sn')->where($where)->delete();
    }

    public static function queryLeftInfo($where,$field){
        return DB::table('t_parent_sn as p')
            ->leftJoin('t_admin_sn as a','p.admin_sn_id','=','a.id')
            ->leftJoin('t_sn_grade as g','p.sn_grade_id','=','g.id')
            ->where($where)
            ->first($field);
    }

    public static function queryFirst($where,$field){
        return DB::table('t_parent_sn')->where($where)->first($field);
    }
}